CC = gcc
CFLAGS = -g -Wall
#LDFLAGS = -lrt
SRCDIR = .
BUILDDIR = ../../build
SRCS = $(SRCDIR)/mqueue.c
TARGETS = $(patsubst $(SRCDIR)/%.c,$(BUILDDIR)/%,$(notdir $(SRCS:.c=)))

all: $(TARGETS)

$(BUILDDIR)/%: $(SRCDIR)/%.c
	$(CC) $(CFLAGS) $< -o $@ -lrt
	@echo "Compiled $@"

clean:
	rm -rf $(BUILDDIR)/*

.PHONY: all clean